{#<!DOCTYPE html>#}
{#<html>#}
{#<head>#}
{#  <title>文件上传</title>#}
{#</head>#}
{#<body>#}
{#  <h2>请选择要上传的文件</h2>#}
{##}
{#  <form action="/upload" method="post" enctype="multipart/form-data">#}
{#      <input type="file" name="file">#}
{#      <input type="submit" value="开始转换">#}
{#  </form>#}
{##}
{#  {% if download_url %}#}
{#    <p>下载路径： <a href="/download/{{ download_url }}">{{ download_url }}</a></p>#}
{#  {% endif %}#}
{#</body>#}
{#</html>#}



<!DOCTYPE html>
<html>
<head>
  <title>文件上传与下载</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      background-color: #f5f5f5;
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: flex-start; /* 垂直方向上偏上 */
      min-height: 100vh;
    }

    .container {
      width: 50%; /* 让容器占据页面一半的宽度 */
      margin-top: 30vh; /* 与页面顶部保持 30% 距离 */
      padding: 20px;
      background-color: #fff;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    h2 {
      margin: 0 0 20px;
      color: #333;
      font-size: 24px;
      text-align: center;
    }

    form {
      margin-top: 20px;
      width: 100%;
    }

    input[type="file"] {
      display: block;
      margin: 10px 0;
      padding: 5px;
      border: 1px solid #ccc;
      border-radius: 5px;
      width: 100%;
    }

    input[type="submit"] {
      background-color: #007bff;
      color: #fff;
      border: none;
      padding: 10px 20px;
      cursor: pointer;
      border-radius: 5px;
      transition: background-color 0.3s;
    }

    input[type="submit"]:hover {
      background-color: #0056b3;
    }

    p {
      margin-top: 20px;
      color: #555;
    }

    a {
      color: #007bff;
      text-decoration: none;
    }
  </style>
</head>
<body>
  <div class="container">
    <h2>请选择要上传的文件，然后点击开始转换按钮</h2>

    <form action="/upload" method="post" enctype="multipart/form-data">
      <input type="file" name="file">
      <input type="submit" value="开始转换">
    </form>

    {% if download_url %}
      <p>下载路径：<a href="/download/{{ download_url }}">{{ download_url }}</a></p>
    {% endif %}
  </div>
</body>
</html>
